﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>CKEditor</title>
    <style type="text/css">
    body
    {
        font-size:13px;
    }
    </style>
</head>
<body>

    <h1>CKEditor</h1>
    <p>官方网站：<a href="http://ckeditor.com/">http://ckeditor.com/</a></p>
    <p>文件下载地址:<a href="http://ckeditor.com/download">http://ckeditor.com/download</a></p>
    <input type="button" value="OpenWindow" onclick="showWindow();"/>
    <div id="win1" class="mini-window" title="CKEditor" style="width:600px;height:450px;" 
        showModal="true" allowResize="true" bodyStyle="padding:0;"
        >
        <!--body-->
        <textarea id="editor1" name="content" style="visibility:hidden">
            <a href="http://www.ckeditor.com/" target="_blank">http://www.ckeditor.com/</a>

        </textarea>
        <div style="text-align:center;padding:8px;">
            <input type="button" value="setText" onclick="setText();"/>
            <input type="button" value="getText" onclick="getText();"/>
        </div>
    </div>        

</body>
</html>


<script src="../../scripts/boot.js" type="text/javascript"></script> 



<script src="http://ckeditor.com/apps/ckeditor/4.3.1/ckeditor.js" type="text/javascript"></script>
<script type="text/javascript">
    mini.parse();
    var editorId = "editor1";
    var editor = CreateEditor();
    function showWindow() {
        var win = mini.get("win1");
        win.show();
    }
    showWindow();


    function setText() {
        var text = "<b>CKEditor</b> <br/>Date:" + new Date().getTime();
        editor.setData(text);
    }
    function getText() {
        var text = editor.getData();
        alert(text);
    }

    //-------------------------------------------------------------
    function CreateEditor() {
        var editor = CKEDITOR.replace('editor1');
        return editor;
        
    }
    
 
</script>